home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 13.0 KB | 342 lines | [TEXT/MPS ] |
- #####################################################################################
- # Application
- #####################################################################################
-
- # (MLH) HACK 8/5/93
- #
- # Summary:
- # Modified the application default link rules to get around an incompatibility
- # between jasik's code coverage tool and the way symantec C++ calls static constructors
- # and destructors which causes static object constructors and destructors to
- # not be called.
- #
- # Problem:
- # The constructors and destructors of a static object are not called when Jasik's
- # code cover tool is used on a program compiled with symnatec C++.
- #
- # Details:
- # Currently symantec C++ creates a jump table for the static constructors
- # and destructors. The constructors and destructors are mixed together in the
- # same table. The code that walks through this table examines the object
- # code at each entry to determine if a given entry is for a constructor or a
- # destructor.
- #
- # Code cover sets a breakpoint at every line of code in the program (there is more to the
- # story, but for our purposes this is enough); breakpoints are illegal instructions
- # that replace legal instructions. When an illegal instruction is intercepted by
- # the the debugger, it replaces it with the original legal instruction and records
- # that the line of code has been executed.
- #
- # The incompatibility between the two systems is caused by code cover modifying
- # the code in the entries for the static constructor/destructor table to set break
- # points. When symantec C++ examines the object code in the table, it does not
- # find the instructions it was expecting so it does not jump through the entry, thus
- # no static constructors or destructors are called.
- #
- # Fix:
- # Pat Nelson is aware of the problem and is going to try and modify the C++ runtime
- # to static constructor and destructors without looking at object code. In the
- # mean time, we can get code cover to not touch the jump table by changing the name
- # of the code segment it lives in. Code cover will ignore the code in any segment
- # whose name contains the string "_IGNORE". So we rename the segment "__ctordtor" to
- # "__ctordtor_IGNORE".
- #
- # Duration:
- # This hack goes away when either Jasik modifies code cover to always ignore
- # the segment "__ctordtor" or Pat finds a way to call the static constructors
- # and destructors without examining object code.
- #
- # -sn __ctordtor=__ctordtor_IGNORE ∂
- # (MLH) HACK - Read hack note above
- #
-
- "{_BedTargetObjectsDir}{__AppName}" ƒƒ ∂
- {__FrameworkObjects} ∂
- {__AppObjects}
- {_BedEcho} {_BedEchoOptions} "Linking: {__AppName}"
- {_BedLink} ∂
- {_BedLinkOptions} ∂
- -sn __ctordtor=__ctordtor_IGNORE ∂
- {__InitLibs} ∂
- {__FrameworkObjects} ∂
- {__OtherObjects} ∂
- {__AppObjects} ∂
- {__SystemObjects} ∂
- -o "{_BedTargetObjectsDir}{__AppName}"
- {_BedEcho} {_BedEchoOptions} "Creator&Bundle: {__AppName}"
- CreatorAndBundle ∂
- {_BedCreatorAndBundleOptions} ∂
- "{_BedTargetObjectsDir}{__AppName}"
-
- "{_BedTargetObjectsDir}{__AppName}" ƒƒ ∂
- "{_BedTargetObjectsDir}BRResourcesCache.Rsrc"
- {_BedEcho} {_BedEchoOptions} "Merging resources for: {__AppName}"
- echo "include ∂"{_BedTargetObjectsDir}BRResourcesCache.Rsrc∂";" ∂
- | {_BedRC} -a -o "{_BedTargetObjectsDir}{__AppName}"
-
- "{_BedTargetObjectsDir}BRResourcesCache.Rsrc" ƒ ∂
- {__FrameworkResources} ∂
- {__AppResources}
- {_BedEcho} {_BedEchoOptions} "Consolidating framework resources for: {__AppName}"
- for __resourceFile__ in {__FrameworkResources}
- echo "include ∂"{__resourceFile__}∂";" ∂
- | {_BedRC} -a -o "{_BedTargetObjectsDir}BRResourcesCache.Rsrc"
- end
- {_BedEcho} {_BedEchoOptions} "Consolidating application resources for: {__AppName}"
- for __resourceFile__ in {__AppResources}
- echo "include ∂"{__resourceFile__}∂";" ∂
- | {_BedRC} -a -o "{_BedTargetObjectsDir}BRResourcesCache.Rsrc"
- end
-
- "{_BedTargetObjectsDir}{__AppName}" ƒƒ
- {_BedEcho} {_BedEchoOptions} " ∂"{_BedTargetObjectsDir}{__AppName}∂" # <- Execute to run your application"
-
-
- #####################################################################################
- # MPW Tool
- #####################################################################################
- "{_BedTargetObjectsDir}{__ToolName}" ƒƒ ∂
- {__ToolObjects}
- {_BedEcho} {_BedEchoOptions} "Linking: {__ToolName}"
- {_BedLink} ∂
- -t 'MPST' -c 'MPS ' ∂
- {_BedLinkOptions} ∂
- {__InitLibs} ∂
- {__ToolObjects} ∂
- {__SystemObjects} ∂
- -o "{_BedTargetObjectsDir}{__ToolName}"
- {_BedEcho} {_BedEchoOptions} " ∂"{_BedTargetObjectsDir}{__ToolName}∂" # <- Execute to run your application"
-
- "{_BedTargetObjectsDir}{__ToolName}" ƒƒ ∂
- {__ToolResources}
- {_BedEcho} {_BedEchoOptions} "Merging Tool resources for: {__ToolName}"
- for __resourceFile__ in {__ToolResources}
- echo "include ∂"{__resourceFile__}∂";" ∂
- | {_BedRC} -a -o "{_BedTargetObjectsDir}{__ToolName}"
- end
-
- "{_BedTargetObjectsDir}{__ToolName}" ƒƒ
- {_BedEcho} {_BedEchoOptions} " ∂"{_BedTargetObjectsDir}{__ToolName}∂" # <- Execute to run your application"
-
-
- #####################################################################################
- # Framework
- #####################################################################################
-
-
- #####################################################################################
- # Static Components
- #####################################################################################
- # Abstract Target dependencies
- "{_BedTargetObjectsDir}{__StaticComponentName}" ƒ ∂
- "{_BedLibDir}{__StaticComponentName}.o" ∂
- "{_BedLibDir}{__StaticComponentName}.rsrc" ∂
- {__OtherComponentDependencies}
-
-
- # Build the library (.o) file
- "{_BedLibDir}{__StaticComponentName}.o" ƒ ∂
- {__ComponentObjects}
- {_BedEcho} {_BedEchoOptions} "Libbing: {__StaticComponentName}.o"
- {_BedLib} ∂
- {_BedLibOptions} ∂
- {__ComponentObjects} ∂
- -o "{_BedLibDir}{__StaticComponentName}.o"
-
- # Consolidate all the library's resource files into one resource file (LibName.rsrc)
- "{_BedLibDir}{__StaticComponentName}.rsrc" ƒ ∂
- {__ComponentResources}
- {_BedEcho} {_BedEchoOptions} "Consolidating resources for: {__StaticComponentName}"
- for __resourceFile__ in {__ComponentResources}
- echo "include ∂"{__resourceFile__}∂";" ∂
- | {_BedRC} -a -t 'rsrc' -c 'RSED' -o "{_BedLibDir}{__StaticComponentName}.rsrc"
- end
-
-
- #####################################################################################
- # Dynamic Components
- #####################################################################################
- # Abstract Target dependencies
- "{_BedTargetObjectsDir}{__DynamicComponentName}" ƒ ∂
- "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM" ∂
- {__OtherComponentDependencies}
- {_BedEcho} {_BedEchoOptions} Copying up ASLM Library: {Targ}
- duplicate -y "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM" "{BedASLMDir}{__DynamicComponentName}ASLM"
- if "`Exists {_BedTargetObjectsDir}{__DynamicComponentName}ASLM.SYM`"
- duplicate -y "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM.SYM" "{BedASLMDir}{__DynamicComponentName}ASLM.SYM"
- End
-
- # Build the library (.o) file
- "{_BedTargetObjectsDir}{__DynamicComponentName}.o" ƒ ∂
- {__ExportedComponentObjects}
- {_BedEcho} {_BedEchoOptions} "Libbing: {__DynamicComponentName}.o"
- {_BedLib} ∂
- {_BedLibOptions} ∂
- {__ExportedComponentObjects} ∂
- -o "{_BedTargetObjectsDir}{__DynamicComponentName}.o"
-
- "{_BedLibDir}{__DynamicComponentName}.cl.o" ƒ ∂
- "{_BedTargetObjectsDir}{__DynamicComponentName}".o ∂
- "{_BedTargetDir}{__DynamicComponentName}".exp
- {_BedEcho} {_BedEchoOptions} Building: {Targ}
- BuildSharedLibrary ∂
- {__IncludeDirs} ∂
- {__BuildSharedLibraryOptions} ∂
- -exp "{_BedTargetDir}{__DynamicComponentName}".exp ∂
- -obj "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM" ∂
- -far "{_BedLibDir}{__DynamicComponentName}.cl.o" ∂
- "{_BedTargetObjectsDir}{__DynamicComponentName}".o
-
- "{_BedTargetObjectsDir}{__DynamicComponentName}Cache.Rsrc" ƒ ∂
- {__FrameworkResources} ∂
- {__ComponentResources}
- {_BedEcho} {_BedEchoOptions} "Consolidating framework resources for: {__DynamicComponentName}"
- for __resourceFile__ in {__FrameworkResources}
- echo "include ∂"{__resourceFile__}∂";" ∂
- | {_BedRC} -a -o "{_BedTargetObjectsDir}{__DynamicComponentName}Cache.Rsrc"
- end
- {_BedEcho} {_BedEchoOptions} "Consolidating Component resources for: {__DynamicComponentName}"
- for __resourceFile__ in {__ComponentResources}
- echo "include ∂"{__resourceFile__}∂";" ∂
- | {_BedRC} -a -o "{_BedTargetObjectsDir}{__DynamicComponentName}Cache.Rsrc"
- end
-
- "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM" ƒ ∂
- "{_BedTargetObjectsDir}{__DynamicComponentName}Cache.Rsrc" ∂
- "{_BedLibDir}{__DynamicComponentName}.cl.o" ∂
- {__OtherObjects} ∂
- {__OpenDocObjects} ∂
- {__ComponentObjects} ∂
- {__FrameworkObjects}
- {_BedEcho} {_BedEchoOptions} Linking: {Targ}
- LinkSharedLibrary ∂
- -lib "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM" ∂
- -obj "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM" ∂
- -symfile "{_BedTargetObjectsDir}{__DynamicComponentName}ASLM.SYM" ∂
- {__LinkSharedLibraryOptions} ∂
- "{_BedLibDir}{__DynamicComponentName}.cl.o" ∂
- {__OpenDocObjects} ∂
- {__FrameworkObjects} ∂
- {__ComponentObjects} ∂
- {__OtherObjects} ∂
- {__SystemObjects}
- If "`Exists {_BedTargetObjectsDir}{__DynamicComponentName}Cache.rsrc`"
- {_BedEcho} {_BedEchoOptions} Copying Resources From: "{_BedTargetObjectsDir}{__DynamicComponentName}Cache.rsrc"
- {_BedEcho} {_BedEchoOptions} "include ∂"{_BedTargetObjectsDir}{__DynamicComponentName}Cache.rsrc∂";" | Rez -a -o {Targ}
- End
-
- #####################################################################################
- # SOM Components
- #####################################################################################
- # Abstract Target dependencies
- "{_BedTargetObjectsDir}{__SOMComponentName}" ƒ ∂
- "{_BedTargetDir}{__SOMComponentName}.lib" ∂
- {__OtherComponentDependencies}
-
- "{_BedTargetDir}{__SOMComponentName}.lib" ƒ ∂
- "{_BedTargetObjectsDir}{__SOMComponentName}.seg"
- {_BedEcho} {_BedEchoOptions} Segmenting and Merging Fragments: "{_BedTargetDir}{__SOMComponentName}.lib"
- Seg2Flat "{_BedTargetObjectsDir}{__SOMComponentName}.seg" -o "{_BedTargetDir}{__SOMComponentName}.lib"
- MergeFragment "{_BedTargetDir}{__SOMComponentName}.lib" -cp -t m68k -n "{__SOMComponentName}"
- SetFile -t shlb -c cfmg "{_BedTargetDir}{__SOMComponentName}.lib"
-
- "{_BedTargetObjectsDir}{__SOMComponentName}.seg" ƒ ∂
- {__ComponentObjects}
- {_BedEcho} {_BedEchoOptions} ILinking: "{_BedTargetDir}{__SOMComponentName}.seg"
- ILink -model -cfmseg -state nouse -pad 0 -compact -t 'shlb' ∂
- -o "{_BedTargetObjectsDir}{__SOMComponentName}.seg" ∂
- {__ComponentObjects} ∂
- {SharedLibraries}SOM.slb ∂
- {NuCLibraries}NuStdCLib.o ∂
- {NuLibraries}NuMacRuntime.o ∂
- {NuLibraries}NuIntEnv.o ∂
- {Libraries}Interface.o ∂
-
-
- #####################################################################################
- # Inference Rules
- #####################################################################################
-
- .a.o ƒ .a
- {_BedEcho} {_BedEchoOptions} "Assembling: {default}.a"
- {_BedAsm} ∂
- {_BedAsmOptions} ∂
- {__IncludeDirs} ∂
- -o {targDir}{default}.a.o ∂
- {depDir}{default}.a
-
-
- .c.o ƒ .c
- {_BedEcho} {_BedEchoOptions} "Compiling: {default}.c"
- {_BedC} ∂
- {_BedCOptions} ∂
- {__COptions} ∂
- {__IncludeDirs} ∂
- -o {targDir}{default}.c.o ∂
- {depDir}{default}.c
-
- .cp.o ƒ .cp
- {_BedEcho} {_BedEchoOptions} "Compiling: {default}.cp"
- {_BedCPlus} ∂
- {_BedCPlusOptions} ∂
- {__CPlusOptions} ∂
- {__IncludeDirs} ∂
- -o {targDir}{default}.cp.o ∂
- {depDir}{default}.cp
-
- .cpp.o ƒ .cpp
- {_BedEcho} {_BedEchoOptions} "Compiling: {default}.cpp"
- {_BedCPlus} ∂
- {_BedCPlusOptions} ∂
- {__CPlusOptions} ∂
- {__IncludeDirs} ∂
- -load {__PrecompiledHeaderFile} ∂
- -o {targDir}{default}.cpp.o ∂
- {depDir}{default}.cpp
-
- .rsrc ƒ .br
- {_BedEcho} {_BedEchoOptions} "BedRC: {default}.br"
- {_BedBedRC} ∂
- {_BedBedRCOptions} ∂
- {__BedRCIncludeDirs} ∂
- -o "{targDir}{default}.rsrc" ∂
- {depDir}{default}.br
-
- .rsrc ƒ .r
- {_BedEcho} {_BedEchoOptions} "Rezzing: {default}.r"
- {_BedRC} ∂
- {_BedRCOptions} ∂
- {__BedRCIncludeDirs} ∂
- {__IncludeDirs} ∂
- -o "{targDir}{default}.rsrc" ∂
- {depDir}{default}.r
-
- #####################################################################################
- # Maintenance Targets
- #####################################################################################
-
- "{_BedTargetObjectsDir}"CleanObj ƒ
- {_BedEcho} {_BedEchoOptions} "Deleting Object Files from: {_BedTargetObjectsDir}"
- delete -y -i {__ComponentObjects}
-
- "{_BedTargetObjectsDir}"CleanRes ƒ
- {_BedEcho} {_BedEchoOptions} "Deleting Resources from : {_BedTargetObjectsDir}"
- delete -y -i {__ComponentResources}
-
- "{_BedTargetObjectsDir}"CleanLib ƒ
- {_BedEcho} {_BedEchoOptions} "Deleting Libraries from : {_BedLibDir}"
- delete -y -i "{_BedLibDir}{__ComponentName}.o"
- delete -y -i "{_BedLibDir}{__ComponentName}.rsrc"
-
- "{_BedTargetObjectsDir}"CleanAll ƒ ∂
- "{_BedTargetObjectsDir}"CleanObjects ∂
- "{_BedTargetObjectsDir}"CleanResources ∂
- "{_BedTargetObjectsDir}"CleanLibs
-
- "{_BedTargetObjectsDir}"KillDir ƒ ∂
- "{_BedTargetObjectsDir}"CleanLibs
- {_BedEcho} {_BedEchoOptions} "Deleting Build Directory: {_BedTargetObjectsDir}"
- delete -y -i "{_BedTargetObjectsDir}"
-
-
-